import { fetchToken, fetch } from '@/utils/fetch'
const sys_url = '/sysinfo-service'
//    ============用户-列表============
export function userList(data) {
  return fetchToken({
	url: '/sysinfo-service/users',
	method: 'get',
	params: data
  })
}
//    ============用户-新增============
export function addUser(data) {
  return fetchToken({
    url: '/sysinfo-service/user',
    method: 'post',
    data
  }, '新增用户成功')
}
//    ============用户-修改============
export function updateUser(data,id) {
  return fetchToken({
    url: `/sysinfo-service/user/${id}`,
    method: 'put',
	data
  }, '修改成功')
}

//    ============用户-查看============
export function lookUser(id) {
  return fetchToken({
	url: `/sysinfo-service/user/${id}`,
	method: 'get',
  })
}
//    ============用户-删除============
export function deleteUser(data) {
  return fetchToken({
    url: '/sysinfo-service/user/delete',
    method: 'post',
    params: data
  })
}

//    ============修改密码============
export function modifyPwd(id, data) {
  return fetchToken({
  url: `${sys_url}/user/modify/${id}`,
  method: 'put',
  params: data
  }, '修改成功,请重新登录')
}


